#include<iostream>
#include<cstdlib>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<math.h>

using namespace std;

double log_2(double n);

int main(int argc, char *argv[])
{
    double a;
    int b;
    int length;
    double m = log_2(10);
    while(cin >> a)
    {
        length = 0;
        b = int(a);
        for(;; )
        {
            if(b / 10 != 0)
            {
                length++;
                b /= 10;
            }
            else
                break;
        }
        length += 2;
        double pre, back;
        int e;
        for(int k = length; ;k++)
        {
            pre = log_2(a)+k*m;
            back = log_2(a+1)+ k*m;
            e = int(ceil(pre));
            if(e < back)
            {
                cout << e << endl;
                break;
            }
        }
    }
    system("PAUSE");
    return EXIT_SUCCESS;
}

double log_2(double n)
{
    return log(n)/log(2.0);
}
